<div class="row animated" ng-class="{true: 'fadeInRight', false:'fadeInLeft'}[currentAnimated]">
  <div class="panel panel-default">
    <div class="panel-heading">
      <a ng-click="discard()" href="javascript:;"><i class="backBtn fa fa-arrow-circle-left"></i></a>
      <span class="panelTitle" ng-bind="ProductForm.title"></span>
    </div>
    <div class="panel-body">
      <form novalidate name="productForm" class="form-horizontal" role="form">
        <div class="form-group" ng-class="{'has-error': productForm.name.$invalid && productForm.name.$dirty}">
          <label class="control-label col-xs-3 col-md-2">商品名称：</label>
          <div class=" col-xs-7 col-md-8">
            <input type="text" class="form-control w25c" name="name" placeholder="商品名称" ng-model="derivatives.name" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.derivativesAuthor.$invalid && productForm.derivativesAuthor.$dirty}">
          <label class="control-label col-xs-3 col-md-2">艺术家：</label>
          <div class=" col-xs-7 col-md-8">
            <select class="form-control w25c" name="derivativesAuthor" required ng-model="derivatives.derivativesAuthor">
              <option value="">----选择艺术家----</option>
              <option ng-repeat="item in derivatives.artistList" value="{{item.id}}">{{item.name}}</option>
            </select>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.derivativesCategory.$invalid && productForm.derivativesCategory.$dirty}">
          <label class="control-label col-xs-3 col-md-2">商品类别：</label>
          <div class=" col-xs-7 col-md-8">
            <select class="form-control w25c" name="derivativesCategory" required ng-model="derivatives.derivativesCategory">
              <option value="">----选择类别----</option>
              <option ng-repeat="item in derivatives.categoryList" value="{{item.id}}">{{item.name}}</option>
            </select>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.baseCommodityCategory.$invalid && productForm.baseCommodityCategory.$dirty}">
          <label class="control-label col-xs-3 col-md-2">商品分类：</label>
          <div class=" col-xs-7 col-md-8">
            <select class="form-control w25c" name="baseCommodityCategory" required ng-model="derivatives.baseCommodityCategory">
              <option value="">----选择分类----</option>
              <option ng-repeat="item in derivatives.typeList" value="{{item.id}}">{{item.name}}</option>
            </select>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.price.$invalid && productForm.price.$dirty}">
          <label class="control-label col-xs-3 col-md-2">商品售价：</label>
          <div class=" col-xs-7 col-md-8">
           <input type="text" class="form-control w25c" name="price" placeholder="商品售价" ng-model="derivatives.price" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.material.$invalid && productForm.material.$dirty}">
          <label class="control-label col-xs-3 col-md-2">商品材质：</label>
          <div class=" col-xs-7 col-md-8">
            <select class="form-control w25c" name="material" required ng-model="derivatives.material">
              <option value="">----选择材质----</option>
              <option ng-repeat="item in derivatives.materialList" value="{{item.id}}">{{item.name}}</option>
            </select>
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">商品规格：</label>
          <div class=" col-xs-7 col-md-8">
            <input type="number" class="form-control fl w80" name="width" placeholder="长" ng-model="derivatives.width" required>
            <input type="number" class="form-control fl w80" name="height" placeholder="宽" ng-model="derivatives.height" require>
            <input type="text" class="form-control fl w80" name="unit" placeholder="单位" ng-model="derivatives.unit" required>
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">商品图片：</label>
          <div class=" col-xs-7 col-md-8">
            <div class="button btn btn-primary" ngf-select="upload($files)" multiple="multiple" ngf-pattern="'image/*'"
              ngf-accept="'image/*'" ngf-max-size="10MB">上传图片</div>
            <iconlist></iconlist>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.content.$invalid && productForm.content.$dirty}">
          <label class="control-label col-xs-3 col-md-2">商品介绍：</label>
          <div class=" col-xs-7 col-md-8">
            <textarea name="content" placeholder="发表的文章内容" id="editor" bind-model="derivatives.content" ng-bind-html="derivatives.content | trustHtml" keditor data-config="options" required ng-model="derivatives.contentBody">
            </textarea>
            <autosave module="derivatives" saveId="{{derivatives.id}}" interval="30000"></autosave>
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">标签：</label>
          <div class=" col-xs-7 col-md-8">
            <input type="text" class="form-control w120 input-tags" name="tags" id="tags" placeholder="标签" ng-model="queryTag" autocomplete="off">
            <tags elemId="tags"></tags>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.status.$invalid && productForm.status.$dirty}">
          <label class="control-label col-xs-3 col-md-2">状态：</label>
          <div class=" col-xs-7 col-md-8">
            <select class="form-control w25c" name="commodityStates" required ng-model="derivatives.commodityStates">
              <option value="">----请选择----</option>
              <option ng-repeat="item in derivatives.commodityStatesList" value="{{item.id}}">{{item.name}}</option>
            </select>
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">文章排序：</label>
          <div class=" col-xs-7 col-md-8">
            <input type="number" class="form-control w25c" name="sorts" placeholder="排序值" ng-model="derivatives.sorts">
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">浏览数：</label>
          <div class=" col-xs-7 col-md-8">
            <input type="number" class="form-control w25c" name="pv" placeholder="浏览数" ng-model="derivatives.pv">
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">收藏数：</label>
          <div class=" col-xs-7 col-md-8">
            <input type="number" class="form-control w25c" name="like" placeholder="收藏数" ng-model="derivatives.like">
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">其它设置：</label>
          <div class=" col-xs-7 col-md-8">
            <input type="checkbox" name="isRecommend" icheck ng-model="derivatives.isRecommend">推荐
          </div>
        </div>
        <div class="form-group">
          <div class="col-xs-4 col-xs-offset-2">
            <button class="btn btn-primary" ng-click="submitForm()" ng-disabled="productForm.$invalid">保存</button>
            <button class="btn btn-white" ng-click="discard()">取消</button>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>

<imagepreview></imagepreview>
<upload-task></upload-task>
<script src="libs/kindeditor/kindeditor.js" type="text/javascript"></script>
<script src="libs/kindeditor/lang/zh-CN.js" type="text/javascript"></script>
